public class Doctor2 {
    private String name;
    private int age;
    private String job;
    private char gender;
    private double sal;

    public Doctor2(String name, int age, String job, char gender, double sal) {
        this.name = name;
        this.age = age;
        this.job = job;
        this.gender = gender;
        this.sal = sal;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public char getGender() {
        return gender;
    }

    public void setGender(char gender) {
        this.gender = gender;
    }

    public double getSal() {
        return sal;
    }

    public void setSal(double sal) {
        this.sal = sal;
    }
    public boolean equals(Object object){
        if(this==object){
            return true;
        }if (!(object instanceof Doctor)) {
            return false;

        }
//            向下转型
            Doctor doctor=(Doctor) object;
            return this.name.equals(doctor.getName())&&this.age==doctor.getAge()&&this.job.equals(doctor.getJob())&&this.gender==doctor.getGender()&&this.sal==doctor.getSal();
        }

}
